package com.kob.backend.service.impl.favorite;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.kob.backend.mapper.FavoriteMapper;
import com.kob.backend.pojo.favorite;
import com.kob.backend.service.favorite.FavoriteDeleteservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class FavoriteDeleteServiceImpl implements FavoriteDeleteservice {
    @Autowired
    private FavoriteMapper favoriteMapper;
    @Override
    public Map<String, String> daletefavorite(Integer userid, Integer productid) {
        QueryWrapper queryWrapper=new QueryWrapper<favorite>();
        queryWrapper.eq("userid",userid);
        queryWrapper.eq("productid",productid);
        favoriteMapper.delete(queryWrapper);
        Map<String,String>map=new HashMap<>();
        map.put("error_message","success");
        return map;
    }
}
